Implement better handling of Wintab tablet context overlap on Win32.
authorRobert Ögren <gtk@roboros.com>
Fri, 25 Feb 2005 00:12:32 +0000 (00:12 +0000)
committerTor Lillqvist <tml@src.gnome.org>
Fri, 25 Feb 2005 00:12:32 +0000 (00:12 +0000)
2005-02-24  Robert Ögren  <gtk@roboros.com>

Implement better handling of Wintab tablet context overlap on
Win32. (#167298)

* gdk/win32/gdkinput-win32.c (_gdk_input_set_tablet_active): New
function that brings any tablet contexts to the top of the overlap
order.
* gdk/win32/gdkinput-win32.h: Declare _gdk_input_set_tablet_active ()
* gdk/win32/gdkevents-win32.c (gdk_event_translate):
Call _gdk_input_set_tablet_active when a window is activated (on
WM_ACTIVATE)

ChangeLog
ChangeLog.pre-2-10
ChangeLog.pre-2-8
gdk/win32/gdkevents-win32.c
gdk/win32/gdkinput-win32.c
gdk/win32/gdkinput-win32.h

index d8090ef164a4b003ece0bb7f3c7f39132274ea18..a69843946e99c35c9997b58dcadddfa5c9980c0d 100644 (file)
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,16 @@
+2005-02-24  Robert Ögren  <gtk@roboros.com>
+
+       Implement better handling of Wintab tablet context overlap on
+       Win32. (#167298)
+
+       * gdk/win32/gdkinput-win32.c (_gdk_input_set_tablet_active): New
+       function that brings any tablet contexts to the top of the overlap
+       order.
+       * gdk/win32/gdkinput-win32.h: Declare _gdk_input_set_tablet_active ()
+       * gdk/win32/gdkevents-win32.c (gdk_event_translate):
+       Call _gdk_input_set_tablet_active when a window is activated (on
+       WM_ACTIVATE)
+
 2005-02-24  Matthias Clasen  <mclasen@redhat.com>
 
        * gtk/gtkfilechooserdefault.c (gtk_file_chooser_default_select_path): 
index d8090ef164a4b003ece0bb7f3c7f39132274ea18..a69843946e99c35c9997b58dcadddfa5c9980c0d 100644 (file)
@@ -1,3 +1,16 @@
+2005-02-24  Robert Ögren  <gtk@roboros.com>
+
+       Implement better handling of Wintab tablet context overlap on
+       Win32. (#167298)
+
+       * gdk/win32/gdkinput-win32.c (_gdk_input_set_tablet_active): New
+       function that brings any tablet contexts to the top of the overlap
+       order.
+       * gdk/win32/gdkinput-win32.h: Declare _gdk_input_set_tablet_active ()
+       * gdk/win32/gdkevents-win32.c (gdk_event_translate):
+       Call _gdk_input_set_tablet_active when a window is activated (on
+       WM_ACTIVATE)
+
 2005-02-24  Matthias Clasen  <mclasen@redhat.com>
 
        * gtk/gtkfilechooserdefault.c (gtk_file_chooser_default_select_path): 
index d8090ef164a4b003ece0bb7f3c7f39132274ea18..a69843946e99c35c9997b58dcadddfa5c9980c0d 100644 (file)
@@ -1,3 +1,16 @@
+2005-02-24  Robert Ögren  <gtk@roboros.com>
+
+       Implement better handling of Wintab tablet context overlap on
+       Win32. (#167298)
+
+       * gdk/win32/gdkinput-win32.c (_gdk_input_set_tablet_active): New
+       function that brings any tablet contexts to the top of the overlap
+       order.
+       * gdk/win32/gdkinput-win32.h: Declare _gdk_input_set_tablet_active ()
+       * gdk/win32/gdkevents-win32.c (gdk_event_translate):
+       Call _gdk_input_set_tablet_active when a window is activated (on
+       WM_ACTIVATE)
+
 2005-02-24  Matthias Clasen  <mclasen@redhat.com>
 
        * gtk/gtkfilechooserdefault.c (gtk_file_chooser_default_select_path): 
index fff80a57c03e7a364ae92aab7f16c42e430dd10b..eb3ea71c71c2ebe0a5d1860baa9c8b3175484760 100644 (file)
@@ -3367,6 +3367,16 @@ gdk_event_translate (GdkDisplay *display,
       break;
  
 #ifdef HAVE_WINTAB
+    case WM_ACTIVATE:
+      /* Bring any tablet contexts to the top of the overlap order when
+       * one of our windows is activated.
+       * NOTE: It doesn't seem to work well if it is done in WM_ACTIVATEAPP
+       * instead
+       */
+      if (LOWORD(msg->wParam) != WA_INACTIVE)
+       _gdk_input_set_tablet_active ();
+      break;
+      
       /* Handle WINTAB events here, as we know that gdkinput.c will
        * use the fixed WT_DEFBASE as lcMsgBase, and we thus can use the
        * constants as case labels.
index 366979f2d4fa1a12e5b19f565a858be0207f9c46..c86c23a3f8d3c1a1afccd4b2f3e724f94782b610 100644 (file)
@@ -1273,6 +1273,32 @@ gdk_device_get_state (GdkDevice       *device,
     }
 }
 
+#ifdef HAVE_WINTAB
+void
+_gdk_input_set_tablet_active (void)
+{
+  GList *tmp_list;
+  HCTX *hctx;
+
+  /* Bring the contexts to the top of the overlap order when one of the
+   * application's windows is activated */
+  
+  if (!wintab_contexts)
+    return; /* No tablet devices found, or Wintab not initialized yet */
+  
+  GDK_NOTE (INPUT, g_print ("_gdk_input_set_tablet_active: "
+       "Bringing Wintab contexts to the top of the overlap order\n"));
+
+  tmp_list = wintab_contexts;
+  while (tmp_list)
+    {
+      hctx = (HCTX *) (tmp_list->data);
+      WTOverlap (*hctx, TRUE);
+      tmp_list = tmp_list->next;
+    }
+}
+#endif /* HAVE_WINTAB */
+
 void 
 _gdk_input_init (GdkDisplay *display)
 {
index 12da3e87be2b79df6c22b5d5c733607366889674..4da256f1abd982093b8c0a86c7f7a18421e5e424 100644 (file)
@@ -168,6 +168,7 @@ gboolean         _gdk_device_get_history     (GdkDevice         *device,
 
 #ifdef HAVE_WINTAB
 void           _gdk_input_wintab_init_check (void);
+void           _gdk_input_set_tablet_active (void);
 #endif /* HAVE_WINTAB */
 
 #endif /* __GDK_INPUT_WIN32_H__ */